package com.A21.GuoSai.demo.service_entity.entity.workflow;

import com.A21.GuoSai.demo.service_entity.utils.MyTypeUtils;
import lombok.*;


@Data
@NoArgsConstructor
@AllArgsConstructor
@Getter
@Setter
@ToString
public class StaticVarValuePojo {
//   工作流Id
   private String flowId;

   private Integer atomId;
//   原子服务名
   private String atomName;
//   参数名
   private String s_name;

   private String varDesc;

   private Boolean isInput;

   private String methodInfo;
//   参数对应的值
   private Object value;

   private Class <? > typeClass;

   private String type;

   public Object getValue() {
        return value;
    }


    public void setValue(String value) throws Exception {
        this.value = MyTypeUtils.stringToTarget(value,typeClass);
    }


    public void setTypeClass(Class<?> typeClass) {
        this.typeClass = typeClass;
        this.type=typeClass.getCanonicalName();
    }


    public void setType(String type) throws ClassNotFoundException {
        this.type = type;
        this.typeClass = Class.forName(type);
    }
}
